Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream: refactor streams #41871

Closed
wants to merge 3 commits into from

Conversation

VoltrexKeyva
Copy link
Member

@VoltrexKeyva VoltrexKeyva commented Feb 6, 2022

  • Use the standard for loop style instead of for..of for consistency.
  • Refactor to use more validators.
  • Avoid using deprecated APIs.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/streams

@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Feb 6, 2022
@VoltrexKeyva VoltrexKeyva added the stream Issues and PRs related to the stream subsystem. label Feb 6, 2022
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@aduh95
Copy link
Contributor

aduh95 commented Feb 6, 2022

Can we use a less scary commit message? 😅

@VoltrexKeyva
Copy link
Member Author

VoltrexKeyva commented Feb 6, 2022

Can we use a less scary commit message? 😅

I'm unsure what you mean by that, do you mean the commit message title? If so, what do you suggest we use instead? (Or if that was a joke :^))

@nodejs-github-bot
Copy link
Collaborator

@aduh95
Copy link
Contributor

aduh95 commented Feb 6, 2022

If so, what do you suggest we use instead?

Regarding the commit title, I suggest: stream: refactor to use more validators and avoid using deprecated APIs.

refactor streams is a bit too broad, and could imply the commit is doing a complete refactor of the stream API.

lib/internal/streams/duplex.js Outdated Show resolved Hide resolved
@VoltrexKeyva
Copy link
Member Author

If so, what do you suggest we use instead?

Regarding the commit title, I suggest: stream: refactor to use more validators and avoid using deprecated APIs.

refactor streams is a bit too broad, and could imply the commit is doing a complete refactor of the stream API.

That exceeds the 50 character limit for commit message titles (because of our linters), and these changes touch upon multiple files, which is why I chose to use refactor streams, I don't think there's a replacement for the current commit message title that explains the changes without exceeding the character limit?

@aduh95
Copy link
Contributor

aduh95 commented Feb 6, 2022

That exceeds the 50 character limit for commit message titles (because of our linters)

It doesn't exceed our 72 character limit so we're good. Another (better?) solution would be to split this into three separate commits.

@Mesteery
Copy link
Contributor

Mesteery commented Feb 6, 2022

Maybe you can split this commit into 3 commits (+ commit-queue-rebase), for example:

  • stream: refactor to use more validators
  • stream: use for loop instead of for-of loop (including the block statement removal and aduh's suggestion)
  • stream: replace the use of static listenerCount

(I'm too slow 👀😄)

@VoltrexKeyva VoltrexKeyva force-pushed the refactor-streams branch 2 times, most recently from 1251528 to 57e292d Compare February 7, 2022 07:41
nodejs-github-bot pushed a commit that referenced this pull request Feb 11, 2022
Use the standard `for` loop style instead of `for..of` for
consistency.

PR-URL: #41871
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Mestery <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
nodejs-github-bot pushed a commit that referenced this pull request Feb 11, 2022
Use more validators where appropriate for consistency.

PR-URL: #41871
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Mestery <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
nodejs-github-bot pushed a commit that referenced this pull request Feb 11, 2022
Avoid usage of the `events.listenerCount()` method as it is
deprecated.

PR-URL: #41871
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Mestery <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
@VoltrexKeyva VoltrexKeyva deleted the refactor-streams branch February 11, 2022 11:52
bengl pushed a commit to bengl/node that referenced this pull request Feb 21, 2022
Use the standard `for` loop style instead of `for..of` for
consistency.

PR-URL: nodejs#41871
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Mestery <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
bengl pushed a commit to bengl/node that referenced this pull request Feb 21, 2022
Use more validators where appropriate for consistency.

PR-URL: nodejs#41871
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Mestery <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
bengl pushed a commit to bengl/node that referenced this pull request Feb 21, 2022
Avoid usage of the `events.listenerCount()` method as it is
deprecated.

PR-URL: nodejs#41871
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Mestery <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
bengl pushed a commit to bengl/node that referenced this pull request Feb 21, 2022
Use the standard `for` loop style instead of `for..of` for
consistency.

PR-URL: nodejs#41871
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Mestery <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
bengl pushed a commit to bengl/node that referenced this pull request Feb 21, 2022
Use more validators where appropriate for consistency.

PR-URL: nodejs#41871
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Mestery <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
bengl pushed a commit to bengl/node that referenced this pull request Feb 21, 2022
Avoid usage of the `events.listenerCount()` method as it is
deprecated.

PR-URL: nodejs#41871
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Mestery <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
@bengl bengl mentioned this pull request Feb 21, 2022
bengl pushed a commit that referenced this pull request Feb 22, 2022
Use the standard `for` loop style instead of `for..of` for
consistency.

PR-URL: #41871
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Mestery <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
bengl pushed a commit that referenced this pull request Feb 22, 2022
Use more validators where appropriate for consistency.

PR-URL: #41871
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Mestery <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
bengl pushed a commit that referenced this pull request Feb 22, 2022
Avoid usage of the `events.listenerCount()` method as it is
deprecated.

PR-URL: #41871
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Mestery <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
@danielleadams
Copy link
Contributor

@VoltrexMaster this doesn't land cleanly in 16.x - do you mind making a backport PR?

@VoltrexKeyva
Copy link
Member Author

@VoltrexMaster this doesn't land cleanly in 16.x - do you mind making a backport PR?

What's blocking it from landing cleanly? I don't see anything that should be changed to land on v16.x

targos pushed a commit that referenced this pull request Jul 12, 2022
Use the standard `for` loop style instead of `for..of` for
consistency.

PR-URL: #41871
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Mestery <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
targos pushed a commit that referenced this pull request Jul 12, 2022
Use more validators where appropriate for consistency.

PR-URL: #41871
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Mestery <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
targos pushed a commit that referenced this pull request Jul 12, 2022
Avoid usage of the `events.listenerCount()` method as it is
deprecated.

PR-URL: #41871
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Mestery <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
targos pushed a commit that referenced this pull request Jul 31, 2022
Use the standard `for` loop style instead of `for..of` for
consistency.

PR-URL: #41871
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Mestery <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
targos pushed a commit that referenced this pull request Jul 31, 2022
Use more validators where appropriate for consistency.

PR-URL: #41871
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Mestery <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
targos pushed a commit that referenced this pull request Jul 31, 2022
Avoid usage of the `events.listenerCount()` method as it is
deprecated.

PR-URL: #41871
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Mestery <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
guangwong pushed a commit to noslate-project/node that referenced this pull request Oct 10, 2022
Use the standard `for` loop style instead of `for..of` for
consistency.

PR-URL: nodejs/node#41871
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Mestery <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
guangwong pushed a commit to noslate-project/node that referenced this pull request Oct 10, 2022
Use more validators where appropriate for consistency.

PR-URL: nodejs/node#41871
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Mestery <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
guangwong pushed a commit to noslate-project/node that referenced this pull request Oct 10, 2022
Avoid usage of the `events.listenerCount()` method as it is
deprecated.

PR-URL: nodejs/node#41871
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Mestery <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.